import 'package:flutter/material.dart';
import 'package:flutter_250303/http/api.dart';

import '../../datas/common_website_data.dart';
import '../../datas/search_hot_key_data.dart';

class HotKeyViewModel extends ChangeNotifier {
  List<SearchHotKeyData>? hotkeyList;
  List<CommonWebsiteData>? websiteList;

  Future<List<CommonWebsiteData>?> getWebsiteList() async {
    websiteList = await Api.instance.getWebsiteList();
  }

  Future<List<SearchHotKeyData>?> getHotkeyList() async {
    hotkeyList = await Api.instance.getHotkeyList();
  }

  Future initData() async {
    getWebsiteList().then((value) {
      getHotkeyList().then((value) {
        notifyListeners();
      });
    });
  }
}
